//
//  MemberCenterCell.m
//  hnGovernment
//
//  Created by 安仔 on 2017/3/15.
//  Copyright © 2017年 安仔. All rights reserved.
//

#import "MemberCenterCell.h"
@interface MemberCenterCell ()

@property (nonatomic, strong) UIImageView *rightArrow;

@end

@implementation MemberCenterCell

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:self.signImg];
        [self.contentView addSubview:self.titleLab];
        [self.contentView addSubview:self.rightArrow];
        [self.contentView addSubview:self.lineView];
        [self.contentView addSubview:self.rightInfotLab];
    }
    return self;
}

- (void)layoutSubviews {

    [super layoutSubviews];
    [self.signImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView.mas_left).offset(54*m6Scale);
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(40*m6Scale, 40*m6Scale));
    }];
    
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.signImg.mas_right).offset(40*m6Scale);
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
    }];
    
    [self.rightArrow mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.contentView.mas_right).offset(-40*m6Scale);
        make.centerY.mas_equalTo(self.titleLab.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(16*m6Scale, 32*m6Scale));
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.contentView.mas_centerX);
        make.bottom.mas_equalTo(self.contentView.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(self.contentView.frame.size.width, 1));
    }];
    
    [self.rightInfotLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.titleLab.mas_centerY);
        make.right.mas_equalTo(self.contentView.mas_right).offset(-80*m6Scale);
    }];
}

- (UILabel *)rightInfotLab {
    if (!_rightInfotLab) {
        _rightInfotLab = [[UILabel alloc] init];
        _rightInfotLab.textColor = [UIColor colorWithHexString:@"999999"];
        _rightInfotLab.font = [UIFont systemFontOfSize:32*m6Scale];
    }
    return _rightInfotLab;
}

- (UIView *)lineView {
    if (!_lineView) {
        _lineView = [[UIView alloc]init];
        _lineView.backgroundColor = BackgroundColor;;
    }
    return _lineView;
}

- (UIImageView *)rightArrow {
    if (!_rightArrow) {
        _rightArrow = [[UIImageView alloc]init];
        _rightArrow.clipsToBounds = YES;
        _rightArrow.image = [UIImage imageNamed:@"menberCenter_tableView_arrow right"];
    }
    return _rightArrow;
}

- (UILabel *)titleLab {

    if (!_titleLab) {
        _titleLab = [[UILabel alloc] init];
        _titleLab.textColor = [UIColor colorWithHexString:@"494949"];
        _titleLab.font = [UIFont systemFontOfSize:32*m6Scale];
    }
    return _titleLab;
}

- (UIImageView *)signImg {
    if (!_signImg) {
        _signImg = [[UIImageView alloc] init];
        _signImg.clipsToBounds = YES;
    }
    return _signImg;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
